package net.wwang.open.dao;

import net.wwang.open.pojo.vo.MenuNodeVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author WangWei
 * @date 2020/8/11
 */
public interface MenuNodeDao extends JpaRepository<MenuNodeVO, String>, JpaSpecificationExecutor<MenuNodeVO> {
	@Query(nativeQuery = true, value = "SELECT `id`, `name`, `parent_id`, `type`, `space` FROM `menu`  WHERE `space` = ?1")
	List<MenuNodeVO> selectAllMenus(@Param("space") String space, @Param("order") String order, @Param("sort") String sort);
}
